package test2.mongodb;

import java.util.function.Consumer;

import com.mongodb.MongoClient;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.MongoIterable;

public class App {
	
	public static void main(String[] args) {
		MongoClient client = new MongoClient("10.255.0.129", 40000);
		MongoDatabase database = client.getDatabase("fengjr_fengfd");
		MongoIterable<String> iters = database.listCollectionNames();
		iters.forEach(new Consumer<String>() {
			@Override
			public void accept(String t) {
				System.out.println(t);
			}
		});
		client.close();
	}

}
